import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { Button, NavBar, Form, Field, Toast, Tabbar, TabbarItem, Icon, Tab, Tabs, Cell, CellGroup, List, PullRefresh } from 'vant'
// 导入amfe-flexible，把手机屏幕划分为10等分，作为html元素的字体大小
import 'amfe-flexible'
// 全局导入两个自定义组件
import ArticleList from './components/ArticleList'
import ArticleItem from './components/ArticleItem'

// 导入时间函数
import { timeAgo } from '@/utils/time'

// 全局注册两个自定义组件
Vue.component(ArticleList.name, ArticleList)
Vue.component(ArticleItem.name, ArticleItem)
// 把时间函数挂载到原型上
Vue.prototype.$timeAgo = timeAgo
Vue.config.productionTip = false

Vue.use(PullRefresh)
Vue.use(List)
Vue.use(Cell)
Vue.use(CellGroup)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Icon)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(Toast)
Vue.use(NavBar)
Vue.use(Button)
Vue.use(Form)
Vue.use(Field)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
